******************
**** Table B2 ****
****************** 

use "$data/paymentdata_ready" , clear

keep if t==1

log using "$output/table b2", replace

reg interventionratiow1 treatmentalldummy2 treatmentalldummy3 treatmentalldummy4 treatmentalldummy5 treatmentalldummy6 treatmentalldummy7 teamdummy* firststickerdummy* , cluster(dayteam)

reg interventionratiow1 treatmentalldummy2 treatmentalldummy3 treatmentalldummy4 treatmentalldummy5 treatmentalldummy6 treatmentalldummy7 teamdummy* firststickerdummy* preratiow1 lastdebt_demeanedw1 prepaymentsmadedummy* , cluster(dayteam)

capture program drop Ey_boot
program define Ey_boot, eclass
twopm interventionratiow1 treatmentalldummy2 treatmentalldummy3 treatmentalldummy4 treatmentalldummy5 treatmentalldummy6 treatmentalldummy7 ///
firststickerdummy* teamdummy* preratiow1 lastdebt_demeanedw1 prepaymentsmadedummy* ///
, firstpart(probit) secondpart(regress) vce(cluster dayteam)
margins, dydx(treatmentalldummy2 treatmentalldummy3 treatmentalldummy4 treatmentalldummy5 treatmentalldummy6 treatmentalldummy7) nose post
end
bootstrap _b, seed(340) reps(1000): Ey_boot
estimates store W 

test treatmentalldummy2 = treatmentalldummy4 // P-Bas vs P-Req
test treatmentalldummy2 = treatmentalldummy5 // P-Bas vs P-Attr
test treatmentalldummy2 + treatmentalldummy3 = treatmentalldummy4 + treatmentalldummy5 // Bas vs PIDA

test treatmentalldummy3 = treatmentalldummy6 // N-Bas vs N-Req
test treatmentalldummy3 = treatmentalldummy7 // P-Bas vs P-Attr
test treatmentalldummy2 + treatmentalldummy3 = treatmentalldummy6 + treatmentalldummy7 // Bas vs NIDA

test treatmentalldummy4 = treatmentalldummy6 // P-Req vs N-Req
test treatmentalldummy5 = treatmentalldummy7 // P-Attr vs N-Attr
test treatmentalldummy4 + treatmentalldummy5 = treatmentalldummy6 + treatmentalldummy7 // PIDA vs NIDA

test treatmentalldummy4 = treatmentalldummy5 // P-Req vs P-Attr
test treatmentalldummy6 = treatmentalldummy7 // N-Req vs N-Attr
test treatmentalldummy4 + treatmentalldummy6 = treatmentalldummy5 + treatmentalldummy7 // Req vs Attr


log close
